import java.io.*;

public class Menu{
	String message;
	int numOpciones;

	public  Menu(String s, int n){
		message=s;
		numOpciones=n;
	}
	public int drawAndValidate() {
		System.out.println (message);

		BufferedReader stdin = (new BufferedReader (new InputStreamReader (System.in)));
		int n = 0;
		String option;
		try {
			option = stdin.readLine();
			n = Integer.parseInt(option);
			if (n < 0 || n > numOpciones){
				System.out.println ("Opción no encontrada");
				this.drawAndValidate();
			}
		}
		catch(IOException e){}
		return n;
	}
}
